/**
 * Copyright (2022, ) Institute of Software, Chinese Academy of Sciences
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 *limitations under the License.
 */
package com.gitee.iscas.schema;

import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.module.jsonSchema.JsonSchema;
import com.fasterxml.jackson.module.jsonSchema.JsonSchemaGenerator;

import io.fabric8.kubernetes.api.model.apps.DaemonSet;
import io.fabric8.kubernetes.api.model.apps.Deployment;
import io.fabric8.kubernetes.api.model.batch.v1.CronJob;

/**
 * @author wuheng@iscas.ac.cn
 * @since  2.1.1
 * 
 */
public class Analyzer {

	
	public static void main(String[] args) throws Exception {
		
		// 创建 Jackson ObjectMapper
        ObjectMapper objectMapper = new ObjectMapper();

        // 创建 JsonSchemaGenerator
        JsonSchemaGenerator schemaGen = new JsonSchemaGenerator(objectMapper);

        // 生成 User 类的 JSON Schema
        JsonSchema schema = schemaGen.generateSchema(DaemonSet.class);

        // 转换为 JSON 字符串格式
        String schemaJson = objectMapper.writerWithDefaultPrettyPrinter().writeValueAsString(schema);

        // 输出生成的 JSON Schema
        System.out.println(schemaJson);
	}
	

}
